home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d18
/
err_func.arc
/
READ.ME
< prev
next >
Wrap
Text File
|
1990-09-16
|
4KB
|
83 lines
ERR_FUNC
A Unit for producing Meaningfull Run time error information.
by: Richard A. Morris Fido (3:640/378) Mail only
Ph: AUST UTZ+10 (07) 878 1194
P.O. Box 544, INDOOROOPILLY QLD 4068, AUSTRALIA
Released into the Public Domain and Simultaneously entered into the
"Great PASCAL Echo" Contest, and the Programmers distribution network.
For anyone who tries to manage a large project, Beta Testers
are a necessary evil, as it is ALWAYS impossible for a programmer
to test his brain child thoroughly :-). The problem with
Beta Testing is that if you don't keep old versions of
Source code (Or Heavens forbid release source to your betas),
When a beta Tester rings in a run-time error, the information
is meaningless, especially if you have made alterations to code
EVEN if it was not in the unit at error. eg:
BETA : Um, Richard we've got a Run-Time error number 5 in 0000:006D
RICHARD: HUH!!!
BETA : Happened after we did a Green thingy.
RICHARD: O.K. I'll Look into it <FX:CLICK> AAARRRRRRGGGGGHHH!!!!
<FX: Running of Compile FIND on 0000:006D> Result: Can't find line
number..... ARRRRRGHHHHHH!!!!! But I only made one change!!!!
Well this may help, As you may know the MAP file generated
with a Fully debuggable (As beta should be) code, contains
enough information to find out EXACTLY (Well to the nearest
line, picky) Where the error occured, in which unit, etc etc.
Let's have another look at that scenario.
BETA : Richard, Looks like we've got a File Not found error
in line 23 of TEST_ERROR.
RICHARD: O.K. It's fixed!
How do I get this peace of mind, read on!
Simply include this unit in you main program's USES clause
{Either the first unit or in the case of overlays after
the OVERLAY unit and your Pre-emptive Overlay loader unit}
Simply said the unit will assign an error handler onto the
Run time error queue, and on notice of a Run Time error will
activate the routine Error_Message. This routine will firstly
give a meaningfull error message, showing the standard turbo
IDE error message, then if this was a DOS error (Good chance),
It'll find out where and what to do about it (This is MsDos
ver 3+ only, sorry), then will do a trace into the stack to
Show How it got to where it got, then annotate each location
with a Line number (If Line number info was compilled for that
unit), and the unit. To get it to do this for Betas, put
the MAP file created when you compiled the program, into the
Path of the main executable (Oh did I mention thanks to the
Latest STAKDUMP dated 18/9/89, it happilly traverses overlayed
code). Try TEST_ERR.EXE and see it for yourself.
A couple of Caveats: Use Dos version 3 or greater for extended
errors.
Why didn't I look up the source to Display
the actual source line.....What you give
source to betas.
It does get upset sometimes under some
stack overflow errors, I haven't aborted
on a stack error as it is infrequent, but
feel free to change it at will.
It has only been tested with Turbo v5.5
Please let me know by netmail if you get it
working on any other version.
Rgds,
R.A.M.